
<%@page import="org.jackysoft.util.*"%>
<%@ page contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib  uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib  uri="http://www.springframework.org/security/tags" prefix="sec" %>
<%@ taglib  uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<style>
.detail-panel {
	display:block;
}
</style>
<c:set var="ptn" value="######0.0000" />
<c:set var="iptn" value="######0" />
<table class="table table-hover table-bordered table-striped table-condensed ">
<thead>
  <tr>
    <th>
    <button class="btn btn-info"
      onclick="doPost('contract/contract!startquery')"
    >继续查询</button>
    </th>    
    <th></th>
    <th></th>
    <th></th>
    <th></th>
    <th></th>
    <th></th>
    <th></th>
    <th></th>
    <th></th>
    <th></th>
    <th></th>
    
  </tr>
  <%
      Months[] ms = Months.values();
      pageContext.setAttribute("months", ms);
      
   %>
  <tr>
   <c:forEach items="${months}" var="m">
         <th>${m.label}月份</th>
   </c:forEach>  
  </tr>
</thead>
<tbody>
  
  <c:forEach items="${pager.rows}" var="item">
   
   <tr class="success">
    <c:forEach items="${months}" var="m">
       <td>   
         <fmt:formatNumber value="${item[m.name]}" pattern="${ptn}"    />
         
       </td>
    </c:forEach>   
  
  </tr>  
  <tr class="info">
  	<c:forEach items="${months}" var="m">
       <td>   
         <button type="button"
           class="btn btn-success btn-mini"
             onclick="getCounter('${m.mySqlExpress}','exprid')"          
          >
                                        笔数
          </button>
          <span class="label label-inverse"></span>
       </td>
    </c:forEach>       
  </tr>
  
   <tr class="info">
    
    <td colspan="12" > 
        <form id="dform"  class="form-horizontal">
        	
        	    <input type="hidden" name="query.sqlId" value="statAllByDate"/>
        	    <input type="hidden" name="query.resultCode" value="detailsOfMonth"/>
    			<input type="hidden" name="query.state" value="START"/>
                <input type="hidden" name="query.fields[0].name" value="year(firedate)">
                <select name="query.fields[0].value" class="logic-control">
                    <option value="2013">2013</option>
                    <option value="2012">2012</option>
                </select>
                <input type="hidden" name="query.fields[0].outOpr" value="并且"/>
                <select name="query.fields[1].name" class="logic-control">
                    <c:forEach items="${months}" var="m">
                        <option value="${m.name}">${m.label}月份</option>
                    </c:forEach>
                </select>
                <input type="hidden" name="query.fields[1].inOpr" value="大于">
                <input type="hidden" name="query.fields[1].value" value="0"/>  
                 <button 
         	  	   class="btn btn-inverse"
        		   type="button"
        		   onclick="toggleValidation(this)"
                    >月份明细
       			</button>            
            
</form>
    </td>
    
   </tr>
  </c:forEach>
</tbody>
</table>
<form id="cform">
  <input type="hidden" name="query.sqlId" value="counterByDate" />
  <input type="hidden" name="query.express" id="exprid"  />
  
</form>
<script type="text/javascript" src="scripts/apps/contract/query.js"></script>